// 登录
import request from '@/utils/request.js'
export const loginApi = ({ username, password }) => {
  return request({
    url: '/user/login',
    method: 'POST',
    data: {
      username,
      password
    }
  })
}

// 注册
export const signIn = ({ username, password }) => {
  return request({
    url: '/user/registered',
    method: 'POST',
    data: {
      username,
      password
    }
  })
}

// 根据条件查询房屋
export const houseApi = ({ cityId }) => {
  return request({
    url: '/houses',
    method: 'GET',
    params: cityId
  })
}

// 获取城市列表数据
export const ctiyApi = ({ level }) => {
  return request({
    url: '/area/city',
    method: 'GET',
    params: { level }
  })
}

// 热门城市列表
export const hotCity = () => {
  return request({
    url: '/area/hot',
    method: 'GET'
  })
}

// 首页轮播图
export const swiperApi = () => {
  return request({
    url: '/home/swiper',
    mothod: 'Get'
  })
}

// 租房小组
export const groupsApi = ({ area }) => {
  return request({
    url: '/home/groups',
    method: 'GET',
    params: {
      area
    }
  })
}
